package com.xingchi.unique.factory;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * uuid生成工厂
 *
 * @author xingchi
 * @date 2023/3/10 18:29
 * @modified xingchi
 */
public class UUIDFactory {

    public String nextId() {
        return nextId(true);
    }

    public String nextId(boolean removeLine) {
        return removeLine ?  UUID.randomUUID().toString().replace("-", "") :  UUID.randomUUID().toString();
    }

    public List<String> nextIds(int count) {
        List<String> result = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            result.add(this.nextId(true));
        }
        return result;
    }

}
